Skip to content

git-artifacts: build with Rust - #140

Merged
dscho merged 1 commit into
mainfrom
enable-rust
Nov 26, 2026
Merged

dscho merged 1 commit into
mainfrom
enable-rust

Conversation

@dscho

@dscho dscho commented Nov 26, 2026

Copy link
Copy Markdown
Member

This is part of building Git for Windows with Rust by default, the remaining checkbox of git-for-windows/git#6276. The matching change in git-for-windows/git-for-windows-automation removes the same opt-out from its git-artifacts and build-and-deploy workflows.

This reverts "git-artifacts: opt out of the Rust bits for now", which
deferred building with Rust (the upstream default since 32d5b905909e7
(Enable Rust by default)) until Git for Windows would drop Windows 8.1
support, as tracked in

	git-for-windows/git#6276

That happened in v2.56.0, and the SDK artifacts this workflow relies on
now include the Rust toolchain (see
#132 and
git-for-windows#67).

Assisted-by: GitHub Copilot
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
dscho merged commit 4817186 into main Nov 26, 2026
24 checks passed
@dscho
dscho deleted the enable-rust branch November 26, 2026 17:04
chrisd8088 added a commit to git-lfs/git-lfs that referenced this pull request Nov 27, 2026
In our integration shell test suite, our tests of the "pure" SSH-based
Git LFS object transfer protocol use the "git-lfs-transfer" program
from the "scutiger-lfs" Rust crate.  In the script used by our
GitHub Actions CI workflow to run our test suite, we therefore
compile this Rust crate before running any tests.

One of the "scutiger-lfs" crate's dependencies is the "libz-sys"
crate, and recently the job in our CI workflow that runs on Windows
began to fail when attempting to compile the build script of the
"libz-sys" crate.

This failure stems from a recent change made to the "minimal" SDK
provided by the Git for Windows project, which our Windows CI job
installs in order to provide several binaries required by our shell
tests and Makefile recipes, including the "msgfmt.exe" binary.

In PR git-for-windows/git-sdk-64#132, Rust support was added to
the SDK, and then in PR git-for-windows/git-sdk-64#140, Rust was
enabled by default, as Rust is expected to be required to build
version 3.0 of Git, whenever that is released.

However, the minimal SDK's manifest does not include the MinGW-w64
C Runtime (CRT) package's Windows API import libraries "libole32.a"
and "liboleaut32.a", which provide the symbols of the "ole32.dll"
and "oleaut32.dll" system dynamic-link libraries:

  https://github.com/git-for-windows/git-sdk-64/blob/4817186b4c57df6e3e7972aa7fc234182f9ef8a0/.sparse/minimal-sdk

The "libz-sys" crate's build script links against the Rust Standard
Library, which in turn requires the "libole32.a" and "liboleaut32.a"
libraries.

  https://github.com/rust-lang/libz-sys/blob/1.1.8/build.rs#L1-L6
  https://github.com/rust-lang/rust/blob/1.100.0/src/bootstrap/src/core/build_steps/dist.rs#L272-L292

When these libraries can not be located, the "libz-sys" crate's
build script can not be compiled, and our Windows CI job fails as
a result.

To avoid this problem, we now adjust our "script/cibuild" script
so that on Windows it adjusts the system PATH environment variable
to place the location of the default Rust tools provided by the
GitHub Actions runner ahead of those provided by the Git for Windows
SDK.

We then also explicitly export the RUSTUP_TOOLCHAIN environment
variable with a value of "stable-x86_64-pc-windows-msvc", which
selects the default Rustup toolchain for the Microsoft Visual C++
(MSVC) ABI on x86 64-bit Windows systems:

  https://rust-lang.github.io/rustup/installation/windows.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant